// 加载非模块化js
/**
 * 只有确认按钮的提示消息框
 * @param {string} src js资源路径
 */
import config from "@/config/config.js";

function loadScript(src) {
  // 创建script标签，引入外部文件
  const script = document.createElement("script");
        
  script.type = "text/javascript";
  // script.src = '/market/static/common/js/CryptoJS.js'
  script.src = process.env.NODE_ENV === "development" ? `${config.environment.domain}${src}` : `${config.environment.domain}${src}`;

  document.getElementsByTagName("head")[0].appendChild(script);

  // 引入成功
  script.onload = () => {
    // console.log("js资源已加载成功了");
  };
  // 引入失败
  script.onerror = () => {
    // console.log("js资源加载失败了");
  };
  const domscript = document.createElement("script");
}
export default loadScript;
